class DynamicFunctionCreator:
    def __init__(self, func_list):
        self.data = 123
        def generated_function(self, **kwargs):
            result = []
            for param in param_names:
                value = kwargs.get(param)
                result.append(f"{param}: {value}")
            return ", ".join(result)

        for key,value in func_list.items():
            param_names = value
            func_name = key
            setattr(self.__class__, func_name, generated_function.__get__(self, self.__class__))


if __name__ == "__main__":
    fun_list={
        "add_function":["a","b"],
        "del_function":["a","b"],
    }
    # 创建类的实例，传入函数名和参数名列表
    example = DynamicFunctionCreator(fun_list)

    # 调用动态生成的函数
    output = example.add_function(a="3", b="2")
    print(output)
    output = example.del_function(a="3", b="2")
    print(output)
    